/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface JgBigScreen extends BasicModel<JgBigScreen>{
police_station:number,  //警务站数量
EquipmentWarning:number,  //设备告警数量
maintenance:number, //维保企业数量
fireAlarm:number, //火情报警数量
secure_enterprise:number, //安全企业数量
offlineTotal:number, //离线企业总数
online_count:number, //在线设备数量
offline_count:number, //离线设备数量
total_count:number, //设备总数
online_rate:number, //故障率
LastMonthCompleted:number, //上月已完成维保数量
total:number, //维保总数
thisMonthUncompleted:number, //本月未完成维保数量
thisMonthCompleted:number, //本月已完成维保数量
LastMonthUncompleted:number, //上月未完成维保数量
total_warnings:number, //火情预警总数
completed_warnings:number, //已处置火情数
uncompleted_warnings:number, //未处置火情数
notDisposed:number, //视频告警未处置
handled:number, //视频告警已处置
alarmTotal:number, //总告警数
unitCode: string, //企业编码
bound: string, //所属区域
name: string, //企业名称
dominantType:string, //企业类型
}

export interface GetCollectingDeviceTotal extends BasicModel<GetCollectingDeviceTotal>{
online_count:number, //在线设备数量
offline_count:number, //离线设备数量
total_count:number, //设备总数
offline_rate:number, //故障率
}

export interface SelectUnit extends BasicModel<SelectUnit>{
    isNewRecord: boolean, 
    id: string,
    tid: string,
    monomer: string,  //是否为单体
    maintenanceFlag: number, //维保标识
    name: string,  //主体名
    dominantType: string, //主体类型
    firePathId: string, //消防单位id
    policeId: string, //警务站id
    maintenanceId: string, //维保单位id
    province: string,
    city: string,
    county: string,
    address: string, //详细地址
    longitude: number, //经度
    latitude: number,  //纬度
    employeesNum: number, //规模
    contacts: string, //联系人
    mobile: string,  //联系号码
    updateTime: string, //更新时间
    bound: string, //点位信息
    path: string, //电子围栏信息
    validForever: string, //是否永久有效
    state: string, //企业状态
    unitCode: string, //企业编码
    fightingEquipment:number, //设备数量
    ioTDevices: number,  //消防物联网设备数量
    operatorDuty: string //微型消防站值班人员
  }

  export interface SelectHiddenDanger extends BasicModel<SelectHiddenDanger>{
    tid: string, //唯一标识
    hazardType: string, //隐患类型
    enterpriseId: string, //企业id
    enterpriseName: string, //企业名称
    regionId: string, //区域id
    regionName: string, //区域名称
    address: string, //详细地址
    hazardDescription: string, //隐患描述
    handlingMethod: string, //处置方式
    selfRepairMethod: string, //是否自行修复
    currentlyTimeout: string, //当前超时
    hasTimeout: string, //是否有超时
    createTime: string, //创建时间
    processStatus: string, //处置状态
    equipmentId: string, //设备id
    equipmentName: string //设备名称
  }

  export interface Inspection extends BasicModel<Inspection>{
    wait_completed_count:number, //待完成巡检数量
    uncompleted_count:number, //未完成巡检数量
    total_count:number, //巡检总数
    completed_count:number, //已完成巡检数量
    }

    export interface EquipmentOnlineDetail extends BasicModel<EquipmentOnlineDetail>{
      isNewRecord: false, //是否为新记录
      id: string, 
      status: string, //设备状态
      tid: string, //设备唯一标识
      equipmentName: string, //设备名称
      equipmentCode: string, //设备编码
      hostId: string, //所属主机id
      enterpriseId: string, //所属企业id
      enterpriseName: string, //所属企业名称
      address: string, //详细地址
      } 

    export interface MaintenanceMonthDetails extends BasicModel<MaintenanceMonthDetails>{
      maintenance_company_name: string, //维保单位名称
      maintenance_company_id: string, //维保单位id
      enterprise_name: string, //所属企业名称
      enterprise_id: string, //所属企业id
      total_count: number, //任务总数
      maintenance_task_id: string, //维保任务id
      completed_count: number, //已完成任务数
      completion_rate: number, //完成率
      month: string, //月份
      year: string, //年份
      } 
    export interface GetEquipmentWarningDetails extends BasicModel<GetEquipmentWarningDetails>{
      id: string,
      tid: string,
      name: string,
      enterpriseId:string,
      enterpriseName: string,
      buildId: string,
      buildName: string,
      regionId: string,
      regionIname: string,
      equipmentId: string,
      equipmentName: string,
      alarmTime: string,
      alarmInfo: string,
      createTime: string,
      taskInfoId: string,
      processId: string,
      state: string,
      meetingID: string,
      } 
    export interface InspectionStatisticsDetail extends BasicModel<InspectionStatisticsDetail>{
      reception_human_name: string,
      task_name:string ,
      reception_human_id: string,
      task_id: number,
      remark:string ,
      task_type_name:string ,
      update_time:string,
      video_url: string,
      feed_back:string ,
      id: number,
      enterprise_code:string ,
      task_status:string ,
      abnormal_total:string ,
      reception_human_phone:string ,
      role_code: string,
      finish_time: string,
      task_type_code:string ,
      role_name:string,
      abnormal:string,
      task_collection:number,
      add_time:string,
      enterprise_name:string ,
      push_time: string,
      time_period:string
      } 

    export interface SameAreaDiffDeviceAlarm extends BasicModel<SameAreaDiffDeviceAlarm>{
      alarm_count:number,
      enterprise_id: string,
      enterprise_name: string
      } 
    export interface HiddenDangerTotal extends BasicModel<HiddenDangerTotal>{
      overdue_warnings: number,
      completed_warnings: number,
      in_hidden_danger: number,
      uncompleted_warnings: number,
      }

    export interface HiddenDangerDeatils extends BasicModel<HiddenDangerDeatils>{
      tid: string,
      hazardType: string,
      enterpriseId: string,
      enterpriseName: string,
      address: string,
      maintenanceEnterprise: string,
      fireDepartment: string,
      hazardDescription:string
      handlingMethod: string,
      selfRepairMethod: string,
      hiddenUrl: string,
      currentlyTimeout: string,
      hasTimeout: string,
      createTime: string,
      assignerId: string,
      assignerName: string,
      processStatus:string,
      reportPerson: string,
      reportPersonName: string,
      reportPersonPhone: string
      }
  export interface SameAreaDiffDeviceAlarmDetail extends BasicModel<SameAreaDiffDeviceAlarmDetail>{
    building_id: number,
    building_name: string,
    device_id: string,
    create_time: string,
    alarm_time: string,
    region_id: number,
    principal_name: string,
    device_type: string,
    enterprise_id: string,
    principal_id: string,
    device_name: string,
    group_id: string,
    region_name: string,
    id: number,
    enterprise_name: string,
    principal_phone: string
    }



//告警类型详情列表
export const AlarmStatisticsDetails = (params?: JgBigScreen | any) =>
  defHttp.postJson<JgBigScreen>({ url: adminPath + '/data/dataDisplay/AlarmStatisticsDetails', params })

//统计 -企业数量 物联网监控 在线用户 火情报警数量
export const getOtherStatistics = (params?: JgBigScreen | any) =>
  defHttp.postJson<JgBigScreen>({ url: adminPath + '/data/dataDisplay/getOtherStatistics', params })

//设备在线离线
export const getEquipmentOnline = (params?: JgBigScreen | any) =>
  defHttp.postJson<JgBigScreen>({ url: adminPath + '/data/dataDisplay/getEquipmentOnline', params })

//维保本月、上月已完成未完成
export const MaintenanceMonthCompleted = (params?: JgBigScreen | any) =>
  defHttp.postJson<JgBigScreen>({ url: adminPath + '/data/dataDisplay/MaintenanceMonthCompleted', params })

//火情预警
export const getEquipmentWarning = (params?: JgBigScreen | any) =>
  defHttp.postJson<JgBigScreen>({ url: adminPath + '/data/dataDisplay/getEquipmentWarning', params })

//物联网监测设备
export const getCollectingDeviceTotal = (params?: GetCollectingDeviceTotal | any) =>
  defHttp.postJson<GetCollectingDeviceTotal>({ url: adminPath + '/data/dataDisplay/getCollectingDeviceTotal', params })

//视频告警
export const getAlarmStatistics = (params?: JgBigScreen | any) =>
  defHttp.postJson<JgBigScreen>({ url: adminPath + '/data/dataDisplay/getAlarmStatistics', params })

//地图撒点企业信息
export const Information = (params?: JgBigScreen | any) =>
  defHttp.postJson<JgBigScreen>({ url: adminPath + '/data/dataDisplay/Information', params })

//地图撒点企业弹窗详细信息
export const selectUnit = (params?: SelectUnit | any) =>
  defHttp.postJson<SelectUnit>({ url: adminPath + '/data/dataDisplay/selectUnit', params })


//地图撒点企业弹隐患细信息
export const selectHiddenDanger = (params?: SelectHiddenDanger | any) =>
  defHttp.postJson<SelectHiddenDanger>({ url: adminPath + '/data/dataDisplay/selectHiddenDangerById', params })

//日常巡检统计
export const getInspectionStatistics = (params?: Inspection | any) =>
  defHttp.postJson<Inspection>({ url: adminPath + '/data/dataDisplay/getInspectionStatistics', params })

//消防设施设备表格详情
export const getEquipmentOnlineByType = (params?: EquipmentOnlineDetail | any) =>
  defHttp.postJson<EquipmentOnlineDetail>({ url: adminPath + '/data/dataDisplay/getEquipmentOnlineByType', params })

//维保监控表格详情
export const MaintenanceMonthDetails = (params?: MaintenanceMonthDetails | any) =>
  defHttp.postJson<MaintenanceMonthDetails>({ url: adminPath + '/data/dataDisplay/MaintenanceMonthDetails', params })

//火情预警表格详情
export const getEquipmentWarningDetails = (params?: GetEquipmentWarningDetails | any) =>
  defHttp.postJson<GetEquipmentWarningDetails>({ url: adminPath + '/data/dataDisplay/getEquipmentWarningDetails', params })

//消防设施设备表格详情
export const getCollectingDeviceDetails = (params?: EquipmentOnlineDetail | any) =>
  defHttp.postJson<EquipmentOnlineDetail>({ url: adminPath + '/data/dataDisplay/getCollectingDeviceDetails', params })

//消防巡检表格详情
export const InspectionStatisticsDetails = (params?: InspectionStatisticsDetail | any) =>
  defHttp.postJson<InspectionStatisticsDetail>({ url: adminPath + '/data/dataDisplay/InspectionStatisticsDetails', params })

//同区域不同设备统计
export const SameAreaDiffDeviceAlarmTotal = (params?: SameAreaDiffDeviceAlarm | any) =>
  defHttp.postJson<SameAreaDiffDeviceAlarm>({ url: adminPath + '/data/dataDisplay/SameAreaDiffDeviceAlarmTotal', params })

//隐患处理统计
export const getHiddenDangerTotal = (params?: SameAreaDiffDeviceAlarm | any) =>
  defHttp.postJson<SameAreaDiffDeviceAlarm>({ url: adminPath + '/data/dataDisplay/getHiddenDangerTotal', params })

//隐患处理详情

export const getHiddenDangerTotalByDate = (params?: HiddenDangerDeatils | any) =>
  defHttp.postJson<HiddenDangerDeatils>({ url: adminPath + '/data/dataDisplay/getHiddenDangerTotalByDate', params })

//同区域不同设备报警详情
export const SameAreaDiffDeviceAlarmDetails = (params?: SameAreaDiffDeviceAlarmDetail | any) =>
  defHttp.postJson<SameAreaDiffDeviceAlarmDetail>({ url: adminPath + '/data/dataDisplay/SameAreaDiffDeviceAlarmDetails', params })

